package goldgame;
import java.awt.*;

/** 
 * A round tile manages painting of a circle
 * in a specified area of the screen.
 *
 * Whenever the object should paint itself, 
 * it is told what size and position that
 * should be used to paint it.
 */
public class RoundTile extends GameTile {
    
    /** The color of the circle */
    private Color color;
    
    /**
     * Creates a circular game tile.
     *
     * @param color the color of the circle.
     */
    public RoundTile(Color color) {
	this.color = color;
    }
    
    /**
     * Draws itself in a given graphics context, position and size.
     *
     * @param g graphics context to draw on.
     * @param x pixel x coordinate of the tile to be drawn.
     * @param y pixel y coordinate of the tile to be drawn.
     * @param d size of this object in pixels.
     */
    public void draw(Graphics g, int x, int y, Dimension d) {
	g.setColor(color);
	g.fillOval(x,y,d.width,d.height);
    }
}
